package com.dt76.smallloanbackendservice.service.zjs.impl;

import com.dt76.smallloanbackendservice.mapper.zjs.LebalMapper;
import com.dt76.smallloanbackendservice.pojo.zjs.Lebal;
import com.dt76.smallloanbackendservice.service.zjs.LebalService;
import com.dt76.smallloanbackendservice.utils.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class LebalServiceImpl implements LebalService {

    @Autowired
    private LebalMapper lebalMapper;

    @Override
    public Page qryPageAllLebal(int pageIndex) {
        Page page = new Page();
        page.setPageIndex(pageIndex);//每次更新当前页
        //更新总条数
        page.setTotalCount(lebalMapper.qryCount());
        List<Lebal> blackUserList =  lebalMapper.qryPageAllLebal(
                (page.getPageIndex()-1)*page.getPageSize(),
                page.getPageSize());
        page.setRows(blackUserList);
        return page;
    }

    @Override
    public void delBlackUser(int userId) {
        lebalMapper.delLebal(userId);
    }

    @Override
    public void udpLebal(int userId, String lebal) {
        lebalMapper.udpLebal(userId,lebal);
    }


}
